package org.sidora.core.context;

import java.awt.BasicStroke;
import java.awt.Color;
import java.net.URL;
import java.util.HashSet;
import java.util.TreeSet;

import javax.swing.ImageIcon;
import org.sidora.core.Category;
import org.sidora.core.Variable;



/**
 * DevastatedContext
 * @author Enric Tartera, Juan Manuel Gimeno, Roger Masgoret
 * @version 1.0
 */
public class DevastatedContext extends Context{

	public TreeSet<Category>destructionTraces = new TreeSet <Category>();
	
    public ImageIcon getIcon() {
        return new javax.swing.ImageIcon(getClass().getResource("/org/sidora/core/context/resources/devasted16.png"));
    }        

	
	public TreeSet<Category> getDestructionTraces() {
		return destructionTraces;
	}
	
	public void setDestructionTraces(TreeSet<Category> destructionTraces) {
		this.destructionTraces = destructionTraces;
	}
	
	public String getStringClass() {	
		return "Devastated";
	}
	
	public HashSet<Variable> getVariableSet() {
		HashSet<Variable> vSet = new HashSet<Variable>();
		String [] labels = {"Traces de destrucci�"};
		
		for (int i =0 ; i< labels.length; i++){
			Variable var = new Variable();
			var.setLabel(labels[i]);
			var.setReferencedClass(this.getStringClass());
			vSet.add(var);
		}
		return vSet;
		
	}
	public String outputVariables(){
		
		
		StringBuffer buf = new StringBuffer();
		buf.append("<html>");
		buf.append("<body>");
		
		buf.append("<table width=\'100%\' border=\'0\' cellspacing=\'0\' cellpadding=\'1\' bgcolor=\'white\'>");
		buf.append("		<tr align=\'right\'bgcolor=\'#CAE1D1\'>");
		buf.append("			<th align=\'right\'><font size=\'3\'color=\'black\' face=\'Lucida\'>Categories:</font></th>");
		buf.append("			<th align=\'left\'></th>");
		buf.append("		</tr>");
		buf.append("		<tr>");
		buf.append("			<td align=\'right\' width=\'25%\'><font size=\'3\'color=\'black\' face=\'Lucida\'><em>Traces de destrucci�:</em></font></td>");
		buf.append("			<td><font size=\'3\'color=\'black\' face=\'Lucida\'>"+destructionTraces+"</font></td>");
		buf.append("		</tr>");
		
		buf.append("</table>");
		
		buf.append("</body>");
		buf.append("</html>");
		
		return buf.toString();
	}

}